package yjj.model.annotation;

import yjj.model.validator.EmailDomainValidator;

import javax.validation.Constraint;
import javax.validation.Payload;
import java.lang.annotation.*;

@Documented
@Constraint(validatedBy = EmailDomainValidator.class)
@Target({ ElementType.FIELD, ElementType.METHOD })// 作用在字段和方法上
@Retention(RetentionPolicy.RUNTIME)
public @interface EmailDomain {
    String message() default "邮箱必须以指定域名结尾";
    Class<?>[] groups() default {};
    Class<? extends Payload>[] payload() default {};

    String[] allowedDomains();
}
